import requests
import time
import os

pageStart = 1
pageEnd = 1
fileName = "momo-1213"
for i in range(pageStart, pageEnd + 1):
    time.sleep(1)
    if i <= 9:
        pictureNum = f"1000{i}"
    if 10 <= i < 100:
        pictureNum = f"100{i}"
    if i >= 100:
        pictureNum = f"10{i}"
    url = f'https://www.momo8.es/wp-content/gallery/{fileName}/{pictureNum}.jpg'
    print(url)
    params = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.139 Safari/537.36"}
    res = requests.get(url=url, params=params).content
    if not os.path.exists(f"./{fileName}"):
        os.makedirs(f"./{fileName}")
    with open(f"./{fileName}/{pictureNum}.jpg", mode='wb', ) as file:
        file.write(res)
